package com.shu.collection;

import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * @author ssm
 * @version V1.0
 * @description:
 * @date 2020/8/18 9:23
 */
@Slf4j
public class DemoLinkedList {


    public static void main(String[] args) {
        /*LinkedList<String> list = new LinkedList<>();
        List<String> list2 = new ArrayList<>();

        //开头添加数据
        list.addFirst("前");
        //末尾添加数据
        list.addLast("后");
        //压栈
        list.push("Java");

        list.offer("c#");

        list.stream().forEach(System.out::println);


        log.info(list.peek());


        list.stream().forEach(System.out::print);

        log.info("获取和删除队列第一个元素:{}" , list.poll());

        log.info("获取队列第一个元素:{}" , list.peek());

        log.info("获取队列第一个元素:{}" , list.pollFirst());
        log.info("获取队列第一个元素:{}" , list.pollFirst());
        list.stream().forEach(System.out::print);*/

        /**
         * 扩容
         */
        List<Integer> list3 = new ArrayList<>();
        for (int i = 0; i < 11; i++) {
            list3.add(i);
        }
        System.out.println("扩容");

    }
}
